<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix='security' uri='http://www.springframework.org/security/tags' %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="jwr"  uri="http://jawr.net/tags-el" %>
<%@ taglib prefix="ui" uri="http://www.sahyadrirestaurant.com/ui/tags"%>


<div id="templatemo_content_section">
    <h1>Customer Reviews:</h1>
    <div id="reviews" style="min-height: 390px;">
    	<div>
    		<div style="width: 600px;float: left;">
    			Thank you for visiting us. We'd love to hear how things are working out. Your feedback will help us and other customer! 
    		</div>
    		<div style="float: right;width: 180px;">
    			<input class="btnClass" id="btnCreateReview" name="btnCreateReview" onclick="createNewReview()"
    				style="float: right;"	type="button" value="Create Your Reviews"/>
    		</div>
    		
    	</div>
    	<div style="float: left;padding-top: 10px;">
			<div>
				<div class="arrow-bullet" style="float: left;margin-top: 8px;">&nbsp;</div>
				<div style="float: left;width: 85px;">Review List</div>
				<div style="width: 688px;border-bottom: 1px solid #55648f;margin-top:-10px;float: left;">&nbsp;</div>
			</div>			
		</div>
		<div style="clear: both;padding-top: 10px;"></div>
		<div class="gray-form-background" style="padding:10px;">
		<div style="display: block;min-height: 100px;" class="block-section" id="allratings">
		<c:choose>
			<c:when test="${fn:length(reviewList)> 0}">
				<c:forEach items="${reviewList}" var="review">
				<div class="block">
					<div class="left-block">
						<img width="64px" height="64px" alt=""
							src="http://images.jdmagicbox.com/webstatic/he.gif">
					</div>
					<div class="right-block">
						<div class="block-name-rating">
							<span class="block-name">${review.ownerName}</span>
							<span class="block-rating">
								<ui:RatingTag rating="${review.rating}"/>												
							</span>
						</div>
						<div class="block-contact-year">
							
								<c:if test="${fn:length(review.maskPhoneNumber)>0 }">
									<span>
									Phone: ${review.maskPhoneNumber}
									</span>
								</c:if>
								<c:if test="${fn:length(review.maskEmailId)>0 }">
									<span>
									Email: ${review.maskEmailId}
									</span>
								</c:if>
							<span></span>
							<span class="block-date-year">${review.formatedReviewDate}</span>
						</div>
						<div style="clear: both;">
						${review.description}</div>
					</div>
				</div>
			</c:forEach>
			</c:when>
			<c:otherwise>
				<div class="block">
					<span>No Reviews are available.</span>
				</div>
			</c:otherwise>
			
		</c:choose>
			
		</div>
		</div>
	</div>
</div>